package com.sen.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sen.entity.WarehouseLog;
import com.sen.entity.WarehouseLogHead;
import com.sen.service.WarehouseLogHeadService;
import com.sen.service.WarehouseLogService;
import com.sen.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**

 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2021-01-08 17:54:40
 */
@RestController
@RequestMapping("warehouseLogHead")
public class WarehouseLogHeadController {
    @Autowired
    WarehouseLogHeadService warehouseLogHeadService;
    @PostMapping("list")
    public R list(@RequestParam Map<String,String> warehouse){
        Page<WarehouseLogHead> page = new Page<>(Integer.parseInt(warehouse.get("current")), Integer.parseInt(warehouse.get("size")));
        IPage<WarehouseLogHead> warehouseLogHead = warehouseLogHeadService.queryAll(page,warehouse);
        return R.ok().put("warehouseLogHead", warehouseLogHead);
    }
}
